package com.baor.vip.service.impl;

import com.baor.vip.domain.BlackChangeDTO;
import com.baor.vip.domain.BrokerChangeDTO;
import com.baor.vip.domain.BrokerChangeVO;
import com.baor.vip.domain.BrokerChangeDTO;
import com.baor.vip.mapper.BrokerMapper;
import com.baor.vip.service.BrokerService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class BrokerServiceImpl implements BrokerService {
    @Autowired
    private BrokerMapper brokerMapper;

    @Override
    public Map<String, Object> selectBrokerVOList(BrokerChangeDTO brokerChangeDTO) {
        BrokerChangeVO brokerChangeVO = brokerMapper.totalBroker();
        List<BrokerChangeDTO> brokerChangeList = brokerMapper.brokerList(brokerChangeDTO);
        PageInfo<BrokerChangeDTO> pageInfo = new PageInfo<>(brokerChangeList);
        Map<String,Object> map = new HashMap<>();
        map.put("brokerChangeVO",brokerChangeVO);
        map.put("brokerChangeList",pageInfo);
        return map;
    }

    @Override
    public List<String> brokerOrginBox() {
        return brokerMapper.brokerOrginBox();
    }
}
